/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giftmemo.objects;

/**
 *
 * @author Egor
 */
public enum Gender {

    MALE("Мужчина"), FAMALE("Женщина");

    private String genderDescription;

    private Gender(String genderDescription) {
        this.genderDescription = genderDescription;
    }

    public String getGenderDescription() {
        return genderDescription;
    }

    public Gender convertStringGenderToEnum(String string) {
        if ("Мужчина".equals(string)) {
            return MALE;
        } else if ("Женщина".equals(string)) {
            return FAMALE;
        }

        throw new IllegalArgumentException(string);
    }

    @Override
    public String toString() {
        return getGenderDescription(); //To change body of generated methods, choose Tools | Templates.
    }
    
    
}
